/// 响应主体内容
class ClientProfileDto {
  /// 用户名
  final String? userName;
  /// 用户姓名
  final String? fullName;
  /// 密码（已加密，需前端解密）
  final String? password;
  /// PIN码（已加密，需前端解密）
  final String? pin;
  /// 用户等级
  final String? levelName;
  /// 邮箱
  final String? email;
  /// 头像地址
  final String? headUrl;
  /// 电话号码
  final String? phone;
  /// 邀请码
  final String? referralCode;
  /// 邀请总人数
  final int? referralNum;
  /// 获得奖励
  final int? reward;

  ClientProfileDto({
    this.userName,
    this.fullName,
    this.password,
    this.pin,
    this.levelName,
    this.email,
    this.headUrl,
    this.phone,
    this.referralCode,
    this.referralNum,
    this.reward,
  });

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (userName != null) data['userName'] = userName;
    if (fullName != null) data['fullName'] = fullName;
    if (password != null) data['password'] = password;
    if (pin != null) data['pin'] = pin;
    if (levelName != null) data['levelName'] = levelName;
    if (email != null) data['email'] = email;
    if (headUrl != null) data['headUrl'] = headUrl;
    if (phone != null) data['phone'] = phone;
    if (referralCode != null) data['referralCode'] = referralCode;
    if (referralNum != null) data['referralNum'] = referralNum;
    if (reward != null) data['reward'] = reward;
    return data;
  }

  factory ClientProfileDto.fromJson(Map<String, dynamic> json) {
    return ClientProfileDto(
      userName: json['userName'],
      fullName: json['fullName'],
      password: json['password'],
      pin: json['pin'],
      levelName: json['levelName'],
      email: json['email'],
      headUrl: json['headUrl'],
      phone: json['phone'],
      referralCode: json['referralCode'],
      referralNum: json['referralNum'],
      reward: json['reward'],
    );
  }
}